<?php

$_mysqli = new mysqli("localhost","root","12345678","djdl"); //链接数据库
if(mysqli_connect_error()){
    exit("sql链接错误");
}
$_mysqli->set_charset("utf8");
$_title = array();
$_result  = $_mysqli->query("select * from djdl_text");
$_html = array(); //创建一个数组 用来存放查询数据
while(!!$rows = $_result->fetch_object()){
    $_html[] = $rows;  //将查询到的数据赋值给数组
}
foreach ($_html as $key => $value) {
    //print_r($_html[$key]);
   $_title[]=$_html[$key]->title;
}

sleep(3);

if($_POST['token'] == "15819588170"){
echo json_encode($_title);
}else if($_GET['token'] == "15819588170"){
    echo json_encode($_title);
}
?>